import ExamStatus from '@/components/type-of-exam/types/exam-status';
import { DetailsQo } from '@/services/quest';
import { DetailResult } from '@/store/answer/types';
// import { DetailResult } from '@/store/answer/types';
import { ExamItem } from '../types';
import DetailItemAdapter from './DetailItemAdapter';

export default class DetailListAdapter {
  parse(value: ExamItem[]): DetailsQo[] {
    const result: DetailsQo[] = [];

    value.forEach((item: ExamItem) => {
      const vo = new DetailItemAdapter().parse(item);
      result.push(vo);
    });

    return result;
  }
  compose(value: DetailResult[], status: ExamStatus): ExamItem[] {
    const result: ExamItem[] = [];

    value.forEach((item, index) => {
      result.push(new DetailItemAdapter().compose(item, index, status));
    });

    return result;
  }
}
